finding how many factors to explain enough from eigenvalues cumulative
Multidimensional Scaling: MDS
conjoint analysis
prepare dataset for collaborative filtering dataset has each user's rating for item train data has complete rating for all items in each user test data does not have rating for some item in each user collaborative filtering caluculate a user's unknown ratings from the user's known rating for other items
tb0=attitude
names(tb0)=c('a0','a1','a2','a3','a4','a5','a6')
tb0$a4[26:30]=NA
tb0$a5[26:30]=NA
tb0$a6[26:30]=NA
tb0$train=c(rep(1,25),rep(0,5))
tb0=cbind(user=paste0('u',1:30),tb0)
tb=as_tibble(tb0)
tb=pivot_longer(tb, cols = c(-user,-train),
names_to = 'item', values_to = 'rating')